<?php
header("Cache-Control: no-cache, must-revalidate");
?>

<h2>Tree Info</h2>

<?php

if (strlen($_GET['tree'])) {
	$tname=$_GET['tree'];
	$allTrees = AFT_MakeTreeDB('all',$tname);	
	foreach ($allTrees as $tree) {
		if ($tree['name'] == $tname || $tree['code'] == $tname) {
?>
<table class="grid">
	<tbody>
		<tr><td><img width="60" height="60" src="<?=str_replace("\\", "/", getcwd()).'/'.$tree['iconurl']?>"></td><td style="font-weight:bold;"><?=$tree['realname']?></td></tr>
		<tr><td>Name</td><td><?=$tree['name']?></td></tr>
		<tr><td>Code</td><td><?=$tree['code']?></td></tr>
		<tr><td>Mastery count</td><td><?=$tree['mascnt']?></td></tr>
		<tr><td>Mastery maximum</td><td><?=$tree['masmax']?></td></tr>
		<tr><td>Mastery stars image</td><td><?=$tree['masimg']?></td></tr>
		<tr><td>Mastery fraction</td><td><?=$tree['mastery']?></td></tr>
		<tr><td>Release date</td><td><?=date("Y-m-d",$tree['date'])?></td></tr>
		<tr><td>Yield coins</td><td><?=$tree['coins']?></td></tr>
		<tr><td>Yield coconuts</td><td><?=$tree['cocos']?></td></tr>
		<tr><td>Yield jade coins</td><td><?=$tree['jade']?></td></tr>
		<tr><td># of Seedlings</td><td><?=$tree['cntSeed']?></td></tr>
		<tr><td># on Farm</td><td><?=$tree['cnt']?></td></tr>
		<tr><td># in Orchards</td><td><?=$tree['cntOrc']?></td></tr>
		<tr><td># in Giftbox</td><td><?=$tree['cntGB']?></td></tr>
		<tr><td># in Storage</td><td><?=$tree['cntST']?></td></tr>
	</tbody>
</table>

<?php
/*     [action] => select
    [actioncnt] => 0
    [actionSeed] => sell
    [actionSeedcnt] => 10000
    [actionGB] => place
    [actionGBcnt] => 0
    [actionST] => 
    [actionSTcnt] => 0
    [actionBred] => tomast
    [actionBredcnt] => 0
    [movetosec] => 0
    [movetoorc] => 0
*/
		}
	}
}
?>
